const {Controller} = require('egg')

class HotcController extends Controller{
    async getHotc() {
        const {ctx} = this;
        try{
            const dbback = await ctx.service.redis.getTopHots()
            ctx.body = {
                code: 200,
                msg: '获取热门视频成功',
                data: dbback
            }
        }catch(err){
            console.log(err)
            ctx.body = {
                code: 500,
                msg: '获取热门视频失败',
                data: null
            }
        }
    }
}

module.exports = HotcController;